@extends('Admin.AdminPublic.publics')
@section('title','订单列表')
@section('main')
<html>
 <head></head>
 <body>
  <div class="mws-panel grid_8"> 
   <div class="mws-panel-header"> 
    <span><i class="icon-table"></i> 订单列表</span> 
   </div> 
   <div class="mws-panel-body no-padding"> 
    <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
    <form action="/adminorder" method="get">
     <div class="dataTables_filter" id="DataTables_Table_1_filter">
      <label><input type="text" name="keyword" aria-controls="DataTables_Table_1"  value="{{$request['keyword'] or ''}}"/></label>
      <input type="submit" class="btn btn-success" value="搜索">
     </div>
     </form>
     <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info"> 
      <thead> 
       <tr role="row">
        <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending" style="width: 140px;">序号</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending" style="width: 192px;">订单号</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending" style="width: 179px;">用户ID</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending" style="width: 120px;">收货人</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 87px;">收货地址</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 87px;">联系方式</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 87px;">下单时间</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 87px;">支付方式</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 87px;">配送方式</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 87px;">总金额</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 87px;">订单状态</th>
        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending" style="width: 87px;">操作</th>
       </tr> 
      </thead> 
      <tbody role="alert" aria-live="polite" aria-relevant="all">
      	@foreach($data as $row)
       <tr class="odd"> 
        <td class="  sorting_1">{{$row->id}}</td> 
        <td class=" ">{{$row->order_num}}</td> 
        <td class=" ">{{$row->user_id}}</td> 
        <td class=" ">{{$row->name}}</td> 
        <td class=" ">{{$row->huo}}{{$row->adds}}</td> 
        <td class=" ">{{$row->phone}}</td> 
        <td class=" ">{{$row->created_at}}</td> 
        <td class=" ">{{$row->pay}}</td>
        <td class=" ">{{$row->logistics}}</td> 
        <td class=" ">{{$row->total}}</td> 
        <td class=" ">
      <!--   <form> -->
          <select onchange="demo(this)">
            <option value="">{{$row->status}}</option>
            <option value="0">未支付</option>
            <option value="1">已支付</option>    
            <option value="2">未发货</option>    
            <option value="3">待收货</option>
            <option value="4">已收货</option>      
          </select>
        <!-- </form> -->
         <!--  <form  action="/adminorder/{{$row->id}}" method="post" onchange="">
            <select>
              @foreach($data as $status)
                <option>{{$status->status}}</option>
                @endforeach
            </select>
             {{csrf_field()}}
            {{method_field('PUT')}} 

          </form> -->
        <!-- {{$row->status}} -->
        </td>
        <td class=" ">
        <a href="adminorder_goods/{{$row->id}}" class="btn btn-success">订单详情<a>
        <a href="adminorder/{{$row->id}}" class="btn btn-success">发货<a>
        </td> 
       @endforeach
      </tbody>
     </table>
     <div class="dataTables_paginate paging_full_numbers" id="pages">
      {{$data->appends($request)->render()}}
     </div>
    </div> 
   </div> 
  </div>
 </body>
</html>
@endsection

<!--
<script type="text/javascript">
   function demo(month)
    {
        var id = month.value;
          //1创建请求(获取ajax对象)
      var  ajax = new XMLHttpRequest();
     
    //2.建立连接
      ajax.open('get','./index.blade.php?id ='+ id,true);
     
    //3.发送请求
      ajax.send();
    //4. 准备一个事件处理带回来的内容
      ajax.onreadystatechange  = function(){
     
        if(ajax.readyState == 4 &&  ajax.status==200){
          var  result =  ajax.responseText;
          alert(result);
        }
  }
    }
   
   // $('th').css('color','red');
</script>-->
